'use strict';

const RouterService = require('./base');

class BannerService extends RouterService {
  constructor(ctx) {
    super(ctx, 'Comment');
  }
  getPageInclude() {
    return [
    ]
  }
  async create(data) {
    let { product_ids } = data;
    // 批量创建评论
    return await this.ctx.model.Comment.bulkCreate(product_ids.map(item => {
      return {
        ...data,
        product_id: item,
        product_ids: undefined
      }
    }));
  }
}

module.exports = BannerService;
